The invention applies more particularly to the case of a coding or a decoding by linear prediction, including coding/decoding of CELP (Coded Excitation Linear Prediction) type. The linear prediction codecs, such as the codecs of ACELP (Algebraic Coded Excitation) type, are reputed to be suited to speech signals, modeling the production thereof well.
The sampling frequency at which the CELP coding algorithm operates is generally predetermined and identical in each coded frame; examples of sampling frequencies are:                8 kHz in the CELP coders defined in ITU-T G.729, G.723.1, G.729.1        12.8 kHz for the CELP part of the 3GPP AMR-WB coders, ITU-T G.722.2, G.718        16 kHz in the coders described for example in the articles by G. Roy, P. Kabal, “Wideband CELP speech coding at 16 kbits/sec”, ICASSP 1991, and by C. Laflamme et al., 16 kbps “wideband speech coding technique based on algebraic CELP”, ICASSP 1991.        
When the sampling frequency of the signal at the input or at the output of the codec is not identical to the internal CELP coding frequency, a resampling is needed. For example:                In the 3GPP AMR-WB codecs, ITU-T G.722.2, the wideband input and output signal is sampled at 16 kHz but the CELP coding works at the frequency of 12.8 kHz. It will be noted that the ITU T G.718 and G.718 Annex C codecs work also with input/output frequencies of 8 and/or 32 kHz, with a CELP core at 12.8 kHz.        In the ITU-T G.729.1 codec, the input signal is normally wideband (at 16 kHz) and the low band (0-4 kHz) is obtained by a bank of filters of QMF type to obtain a signal sampled at 8 kHz before coding by a CELP algorithm derived from the ITU-T G.729 and G.729 Annex A codecs.        
Different methods for changing sampling frequency, also called resampling, of a digital signal are known, by using, for example in a nonexhaustive manner, up-sampling and down-sampling operations combined with an FIR (Finite Impulse Response) filtering, an IIR (Infinite Impulse Response) filtering or, more directly, a polynomial interpolation (including the splines). A review of the conventional resampling methods can be found for example in the article by R. W. Schafer, L. R. Rabiner, A Digital Signal Processing Approach to Interpolation, Proceedings of the IEEE, vol. 61, no. 6, June 1973, pages 692-702.
The advantage of FIR filtering (symmetrical) lies in its simplified implementation and—subject to certain conditions—in the possibility of ensuring a linear phase. A filtering with linear phase makes it possible to preserve the waveform of the input signal, but it can also be accompanied by a temporal spreading (“ringing”) that can create artifacts of pre-echo type on transients. This method results in a delay (which is a function of the length of the impulse response), generally of the order of one to a few ms to ensure appropriate filtering characteristics (in-band ripple, rejection level sufficient to eliminate aliasing or spectral images, etc.).
The alternative of a resampling by IIR filtering generally leads to a non linear phase, unless the phase is compensated by an additional all-pass filtering stage, as described for example in the article by P. A. Regalia, S. K. Mitra, P. P. Vaidyanathan, The Digital All-Pass Filter: A Versatile Signal Processing Building Block, Proceedings of the IEEE, vol. 76, no. 1, January 1988, with an example of implementation in the “iirgrpdelay” routine of the MATLAB software; an IIR filter is generally of lower order but more complex to implement in fixed point notation, the states (or memories) of the filter being able to reach values of high dynamic range for the recursive part, and this problem is amplified if a phase compensation by all-pass filtering is used.
A resampling technique is described, for example, in ITU-T recommendation G.722.2 (also called AMR-WB standard) describing the AMR-WB codecs. In this standard, the input signal sampled at 16 kHz is divided into 20 ms frames and down-sampled at an internal frequency of 12.8 kHz before applying a coding of CELP type; the signal decoded at 12.8 kHz is then resampled at 16 kHz and combined with a high-band signal. The advantage of going through an intermediate frequency of 12.8 kHz is that it makes it possible to reduce the complexity of the CELP coding and also to have a frame length which is a power of 2, which simplifies the coding of some CELP parameters. The method used in AMR-WB is a conventional resampling by a factor of 4/5 by FIR filtering (with an impulse response of 121 coefficients at 64 kHz).
In theory, the FIR resampling by a factor of 4/5 in the AMR-WB coder can be performed according to the following steps:                up-sampling by 4 (from 16 kHz to 64 kHz) by addition of 3 samples at 0 after each input sample at 16 kHz;        low-pass filtering at the frequency of 64 kHz by a transfer function Hdecim(Z) of symmetrical FIR type of order 120 and of cutoff frequency close to 64 kHz;        down-sampling by 5 (from 64 kHz to 12.8 kHz) by keeping only one sample in five of the signal at the output of the filter Hdecim(Z).        
In practice, this resampling is implemented in an equivalent manner in the AMR-WB coder according to a polyphase implementation without calculating the intermediate signal at 64 kHz and therefore without explicitly adding zeros to the signal to be converted. For each sample at 12.8 kHz at the output of the resampling, an FIR filtering is applied at 16 kHz by using a “phase” of the impulse response of the filter Hdecim(Z), which is equivalent to an FIR filter of order 30 at 16 kHz with a delay of 15 samples at 16 kHz, i.e. 0.9375 ms.
Interest here is focused on a category of codecs supporting at least two internal sampling frequencies, the sampling frequency being able to be selected adaptively in time and variable from one frame to another. Generally, for a range of “low” bit rates, the CELP coder will work at a lesser sampling frequency, for example fs1=12.8 kHz and, for a range of higher bit rates, the coder will work at a higher frequency, for example fs2=16 kHz. A change of bit rates over time, from one frame to another, will in this case bring about a switchover between these two frequencies (fs1 and fs2) depending on the range of bit rates covered. This frequency switchover between two frames can cause audible and objectionable artifacts, particularly because the resampling memories have to be correctly defined and they are not directly accessible when the frequency of the resampling input signal is variable.
When the internal CELP decoding frequency is different from the output frequency, a resampling of the signal synthesized by the CELP decoder will then have to be performed to a common output frequency of the codec fsout, defined for the duration of the coded sequence (or of the communication).
Now, the resampling methods that exist in the prior art are generally defined between fixed frequencies before and after resampling. These methods do not make it possible to perform a resampling of a signal where the frequency before and/or after resampling is variable per frame and notably the case where a resampling at a first frequency on a signal frame is performed while the preceding frame has a sampling frequency different from the first.
There is therefore a need to ensure an optimal resampling (without audible and objectionable artifacts) of each frame in the case of a codec having at least two different sampling frequencies.